<%= form_for(@category) do |f| %>
    <% if @category.errors.any? %>
        <div id="error_explanation">
            <h2><%= pluralize(@category.errors.count, t('common.error')) %> <%=t('message.error.category.header')%></h2>
            <ul>
                <% @category.errors.full_messages.each do |msg| %>
                    <li><%= msg %></li>
                <% end %>
            </ul>
        </div>
    <% end %>
    <%= f.hidden_field :amount%>
    <%= f.hidden_field :enabled%>
    <div class="margin-top10">
        <%= label_tag :name, t('field.common.name'), :class => "form-label" %><br />
        <%= f.text_field :name, :class => "input-field", :id => "name"%>
    </div>
    <div class="margin-top10">
        <%= label_tag :description, t('field.common.description'), :class => "form-label" %><br />
        <%= f.text_area :description, :size => "60x6", :class => "text-area", :id => "description"%>
    </div>
    <div class="margin-top10">
        <%= label_tag :colorFieldId, t('field.category.color'), :class => "form-label" %>
        <%= f.text_field :color, :id => "colorFieldId", :class => "category-color-field", :readOnly => "readOnly"%>
    </div>
    <div class="actions form-buttons">
        <%= f.submit "", :class=>"save-button", :title=>t('button.save')%>
    </div>
<% end %>

<script type="text/javascript">
    jQuery(document).ready(function(){
        categoriesJS.formInit();
    });
</script>